class Solution6 {
    public static double myPow(double x, int n) {
        if(n == 0) return 1;
        double tmp;
        if(n < 0) {
            tmp = myPow(x,n/2);
            return n % 2 == 0 ? tmp * tmp : tmp * tmp * 1.0/x;
        }
        else {
            tmp = myPow(x,n/2);
            return n % 2 == 0 ? tmp * tmp : tmp * tmp * x;
        }

    }

    public static void main(String[] args) {
        double k = myPow(2,-2);
        System.out.println(k);
    }
}